package com.campus.app.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.campus.commons.entity.ClassRoom;
import com.campus.commons.utils.MyPage;
import com.campus.commons.utils.Result;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * 教室表 服务类
 * </p>
 *
 * @author Rin
 * @since 2020-12-28
 */

public interface ClassRoomsService extends IService<ClassRoom> {
    /**
     * 获取全部
     *
     * @param size
     * @param limit
     * @return
     */
    Result<List<ClassRoom>> getAll(int size, int limit);

    /**
     * 模糊查询
     * @param size
     * @param limit
     * @param classRoomName
     * @param
     * @return
     */
    Result<List<ClassRoom>> getAllByLike(int size, int limit, String classRoomName);

    /**
     * 添加ClassRoom
     * @param classRoom
     * @return
     */
    Result add(@NotNull ClassRoom classRoom);

    /**
     * 删除ClassRoom
     *
     * @param id
     * @return
     */
    Result del(@Min(1) Integer id);

    /**
     * 更新Classroom
     * 注意更新classRoom的缓存
     * @param classRoom
     * @return
     */
    Result upDate(@NotNull ClassRoom classRoom);

    /**
     * 获取当天是空闲的教室
     * @param myPage 分页对象
     * @param date   当天日期
     * @return 工具
     */
    Result<List<ClassRoom>> getClassRoomIsNullByDate(MyPage myPage, @NotNull String date);

    /**
     * 判断是否存在这个教室通过教室名称
     *
     * @param classRoomName
     * @return
     */
    Boolean exitClassRoomByName(@NotNull String classRoomName);
}
